package br.com.guarana.business.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author rogerio
 */
@Entity
@Table(name = "estipulante")
@NamedQueries({@NamedQuery(name = "Estipulante.findEstipulanteAll", query = "SELECT r FROM Estipulante r"),
               @NamedQuery(name = "Estipulante.findEstipulanteById", query = "SELECT r FROM Estipulante r WHERE r.id = :id")})
@SequenceGenerator(name = "estipulante_id_seq", sequenceName = "estipulante_id_seq", allocationSize = 1)


public class Estipulante implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(generator = "estipulante_id_seq", strategy = GenerationType.AUTO)        
    @Column(name = "id", nullable = false)
    private Integer id;
    
    @Column(name = "nome", length = 100)
    private String nome;

    public Estipulante() {
    }

    public Estipulante(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Estipulante)) {
            return false;
        }
        Estipulante other = (Estipulante) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.guarana.business.model.Estipulante[ id=" + id + " ]";
    }    
}
